import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    // 首页
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    // 登录页面
    path: "/login",
    name: "login",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Login.vue"),
  },
  {
    // 注册页面
    path: "/register",
    name: "register",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Regist.vue"),
  },
  {
    // 目的地
    path: "/destination",
    name: "destination",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Destination.vue"),
  },
  {
    path: "/toasts",
    name: "toasts",
    component: () =>
      import(/* webpackChunkName: "about" */ "../components/Toasts.vue"),
  },
  {
    path: "/strategy",
    name: "strategy",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Strategy.vue"),
  },

  {
    path: "/detail",
    name: "detail",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Detail.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
